package com.ck.controller.teacher;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.ck.domain.Exam;
import com.ck.service.ExamService;

public class ShowUnstartExamListController extends AbstractController {
	
	private ExamService examService;

	public void setExamService(ExamService examService) {
		this.examService = examService;
	}
	
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		Map model = new HashMap();
		
		List<Exam> unstartExamList = examService.gainUnstartExamList();
		
		model.put("unstartExamList", unstartExamList);
		
		return new ModelAndView("teacher/showUnstartExamList", model);
	}

}
